idf_component_register(SRCS "main.c"
                            "app_wifi/app_wifi.c"
                            "app_nvs/app_nvs.c"
                            "app_mqtt/app_mqtt.c"
                            "app_provisioning/app_provisioning.c"
                            "app_iot_ctrl/app_iot_ctrl.c"
                            "app_ota/app_ota.c"
                            "app_tcp/app_tcp_server.c"
                            "app_mdns/app_mdns.c"
                            "app_udp/app_udp.c"
                            "app_energy_storage/app_energy_storage.c"
                    INCLUDE_DIRS "app_wifi"
                                "app_mqtt"
                                "app_provisioning"
                                "app_iot_ctrl"
                                "app_ota"
                                "app_tcp"
                                "app_mdns"
                                "app_udp"
                                "app_energy_storage"
                                "app_nvs")

target_compile_definitions(${COMPONENT_LIB} PUBLIC PROJECT_VER="${PROJECT_VER}")

execute_process(
    COMMAND git describe --always --dirty
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    OUTPUT_VARIABLE GIT_COMMIT_ID
    OUTPUT_STRIP_TRAILING_WHITESPACE
)
target_compile_definitions(${COMPONENT_LIB} PUBLIC APP_COMMIT_ID="${GIT_COMMIT_ID}")